﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Data;
using System.Data.SqlClient;
using System.Web.Mvc;
using Model.WaiGaoQiao;
using WaiGaoQiaoWeb.Models;
using WaiGaoQiaoWeb.JsonEntities;

namespace WaiGaoQiaoWeb.Controllers
{
    public class RefrigerationController : Controller
    {
        private RefrigerationInfo fundinfo = new RefrigerationInfo();
        public ActionResult RefrigerationIndex()
        {
            ViewData["BanCi"] = GetBanCi();
            return View();
        }
        public IList<SelectListItem> GetBanCi()
        {
            IDictionary<int, string> dic = new Dictionary<int, string>();
            dic.Add(-1, "全部");
            dic.Add(0, "早班");
            dic.Add(1, "夜班");
            IList<SelectListItem> selectList =
                dic.Select(m => new SelectListItem() { Text = m.Value.ToString(), Value = m.Key.ToString() }).ToList();
            return selectList;
        }

        public DataSet GetList(string DateTime, string BanCi)
        {
            string strwhere = " and 1=1 ";
            if (DateTime != "")
            {
                strwhere += " and convert(varchar(10),Rdate,120)='" + DateTime + "'";
            }
            if (BanCi != "")
            {
                strwhere += " and DataFlag='" + BanCi + "'";
            }
            DataSet list = fundinfo.BindList(0, 24, strwhere);
            return list;
        }

        public ActionResult GetListNew(PageVM pvm)
        {
            string query = " where 1=1 ";
            if (string.IsNullOrEmpty(pvm.query))
            {
                query += " and 1=1";
            }
            else
            {
                string[] param = pvm.query.Split(',');
                if (param[0].ToString() != "")
                {
                    query += " and Rdate>='" + param[0] + "'";
                }
                if (param[1].ToString() != "")
                {
                    query += " and Rdate<='" + param[1] + "'";
                }
                if (param[2].ToString() != "-1")
                {
                    query += " and DataFlag='" + param[2] + "'";
                }
            }
            int count;
            IList<RefrigerationInfo> menlist = fundinfo.GetListNew(pvm.rp, pvm.page, query, out count);
            JsonFlexiGridData jfgd = new JsonFlexiGridData();
            jfgd.page = pvm.page;
            jfgd.total = count;
            List<string> v;
            foreach (RefrigerationInfo item in menlist)
            {
                #region
                v = new List<string>();
                v.Add(item.rownumber.ToString());
                v.Add(item.BanCiID.ToString());
                v.Add(Convert.ToDateTime(item.Rdate).ToString("yyyy-MM-dd"));
                v.Add(item.BanCi.ToString());
                v.Add(item.OperatorID.ToString());
                #endregion
                FlexiGridRow fgr = new FlexiGridRow()
                {
                    id = item.rownumber.ToString(),
                    cell = v
                };
                jfgd.rows.Add(fgr);
            }
            return Json(jfgd);
        }

        public ActionResult SaveRefrigeration(RefrigerationVM model)
        {
            int result = 0;
            if (ModelState.IsValid)
            {
                string[,] strs = new string[23, 13];
                strs[0, 0] = model.R1T1;
                strs[0, 1] = model.R1T2;
                strs[0, 2] = model.R1T3;
                strs[0, 3] = model.R1T4;
                strs[0, 4] = model.R1T5;
                strs[0, 5] = model.R1T6;
                strs[0, 6] = model.R1T7;
                strs[0, 7] = model.R1T8;
                strs[0, 8] = model.R1T9;
                strs[0, 9] = model.R1T10;
                strs[0, 10] = model.R1T11;
                strs[0, 11] = model.R1T12;
                strs[0, 12] = "20";

                strs[1, 0] = model.R2T1;
                strs[1, 1] = model.R2T2;
                strs[1, 2] = model.R2T3;
                strs[1, 3] = model.R2T4;
                strs[1, 4] = model.R2T5;
                strs[1, 5] = model.R2T6;
                strs[1, 6] = model.R2T7;
                strs[1, 7] = model.R2T8;
                strs[1, 8] = model.R2T9;
                strs[1, 9] = model.R2T10;
                strs[1, 10] = model.R2T11;
                strs[1, 11] = model.R2T12;
                strs[1, 12] = "21";

                strs[2, 0] = model.R3T1;
                strs[2, 1] = model.R3T2;
                strs[2, 2] = model.R3T3;
                strs[2, 3] = model.R3T4;
                strs[2, 4] = model.R3T5;
                strs[2, 5] = model.R3T6;
                strs[2, 6] = model.R3T7;
                strs[2, 7] = model.R3T8;
                strs[2, 8] = model.R3T9;
                strs[2, 9] = model.R3T10;
                strs[2, 10] = model.R3T11;
                strs[2, 11] = model.R3T12;
                strs[2, 12] = "22";

                strs[3, 0] = model.R4T1;
                strs[3, 1] = model.R4T2;
                strs[3, 2] = model.R4T3;
                strs[3, 3] = model.R4T4;
                strs[3, 4] = model.R4T5;
                strs[3, 5] = model.R4T6;
                strs[3, 6] = model.R4T7;
                strs[3, 7] = model.R4T8;
                strs[3, 8] = model.R4T9;
                strs[3, 9] = model.R4T10;
                strs[3, 10] = model.R4T11;
                strs[3, 11] = model.R4T12;
                strs[3, 12] = "23";

                strs[4, 0] = model.R5T1;
                strs[4, 1] = model.R5T2;
                strs[4, 2] = model.R5T3;
                strs[4, 3] = model.R5T4;
                strs[4, 4] = model.R5T5;
                strs[4, 5] = model.R5T6;
                strs[4, 6] = model.R5T7;
                strs[4, 7] = model.R5T8;
                strs[4, 8] = model.R5T9;
                strs[4, 9] = model.R5T10;
                strs[4, 10] = model.R5T11;
                strs[4, 11] = model.R5T12;
                strs[4, 12] = "24";

                strs[5, 0] = model.R6T1;
                strs[5, 1] = model.R6T2;
                strs[5, 2] = model.R6T3;
                strs[5, 3] = model.R6T4;
                strs[5, 4] = model.R6T5;
                strs[5, 5] = model.R6T6;
                strs[5, 6] = model.R6T7;
                strs[5, 7] = model.R6T8;
                strs[5, 8] = model.R6T9;
                strs[5, 9] = model.R6T10;
                strs[5, 10] = model.R6T11;
                strs[5, 11] = model.R6T12;
                strs[5, 12] = "25";

                strs[6, 0] = model.R7T1;
                strs[6, 1] = model.R7T2;
                strs[6, 2] = model.R7T3;
                strs[6, 3] = model.R7T4;
                strs[6, 4] = model.R7T5;
                strs[6, 5] = model.R7T6;
                strs[6, 6] = model.R7T7;
                strs[6, 7] = model.R7T8;
                strs[6, 8] = model.R7T9;
                strs[6, 9] = model.R7T10;
                strs[6, 10] = model.R7T11;
                strs[6, 11] = model.R7T12;
                strs[6, 12] = "26";

                strs[7, 0] = model.R8T1;
                strs[7, 1] = model.R8T2;
                strs[7, 2] = model.R8T3;
                strs[7, 3] = model.R8T4;
                strs[7, 4] = model.R8T5;
                strs[7, 5] = model.R8T6;
                strs[7, 6] = model.R8T7;
                strs[7, 7] = model.R8T8;
                strs[7, 8] = model.R8T9;
                strs[7, 9] = model.R8T10;
                strs[7, 10] = model.R8T11;
                strs[7, 11] = model.R8T12;
                strs[7, 12] = "27";

                strs[8, 0] = model.R9T1;
                strs[8, 1] = model.R9T2;
                strs[8, 2] = model.R9T3;
                strs[8, 3] = model.R9T4;
                strs[8, 4] = model.R9T5;
                strs[8, 5] = model.R9T6;
                strs[8, 6] = model.R9T7;
                strs[8, 7] = model.R9T8;
                strs[8, 8] = model.R9T9;
                strs[8, 9] = model.R9T10;
                strs[8, 10] = model.R9T11;
                strs[8, 11] = model.R9T12;
                strs[8, 12] = "28";

                strs[9, 0] = model.R10T1;
                strs[9, 1] = model.R10T2;
                strs[9, 2] = model.R10T3;
                strs[9, 3] = model.R10T4;
                strs[9, 4] = model.R10T5;
                strs[9, 5] = model.R10T6;
                strs[9, 6] = model.R10T7;
                strs[9, 7] = model.R10T8;
                strs[9, 8] = model.R10T9;
                strs[9, 9] = model.R10T10;
                strs[9, 10] = model.R10T11;
                strs[9, 11] = model.R10T12;
                strs[9, 12] = "29";

                strs[10, 0] = model.R11T1;
                strs[10, 1] = model.R11T2;
                strs[10, 2] = model.R11T3;
                strs[10, 3] = model.R11T4;
                strs[10, 4] = model.R11T5;
                strs[10, 5] = model.R11T6;
                strs[10, 6] = model.R11T7;
                strs[10, 7] = model.R11T8;
                strs[10, 8] = model.R11T9;
                strs[10, 9] = model.R11T10;
                strs[10, 10] = model.R11T11;
                strs[10, 11] = model.R11T12;
                strs[10, 12] = "30";

                strs[11, 0] = model.R12T1;
                strs[11, 1] = model.R12T2;
                strs[11, 2] = model.R12T3;
                strs[11, 3] = model.R12T4;
                strs[11, 4] = model.R12T5;
                strs[11, 5] = model.R12T6;
                strs[11, 6] = model.R12T7;
                strs[11, 7] = model.R12T8;
                strs[11, 8] = model.R12T9;
                strs[11, 9] = model.R12T10;
                strs[11, 10] = model.R12T11;
                strs[11, 11] = model.R12T12;
                strs[11, 12] = "31";

                strs[12, 0] = model.R13T1;
                strs[12, 1] = model.R13T2;
                strs[12, 2] = model.R13T3;
                strs[12, 3] = model.R13T4;
                strs[12, 4] = model.R13T5;
                strs[12, 5] = model.R13T6;
                strs[12, 6] = model.R13T7;
                strs[12, 7] = model.R13T8;
                strs[12, 8] = model.R13T9;
                strs[12, 9] = model.R13T10;
                strs[12, 10] = model.R13T11;
                strs[12, 11] = model.R13T12;
                strs[12, 12] = "32";

                strs[13, 0] = model.R14T1;
                strs[13, 1] = model.R14T2;
                strs[13, 2] = model.R14T3;
                strs[13, 3] = model.R14T4;
                strs[13, 4] = model.R14T5;
                strs[13, 5] = model.R14T6;
                strs[13, 6] = model.R14T7;
                strs[13, 7] = model.R14T8;
                strs[13, 8] = model.R14T9;
                strs[13, 9] = model.R14T10;
                strs[13, 10] = model.R14T11;
                strs[13, 11] = model.R14T12;
                strs[13, 12] = "33";

                strs[14, 0] = model.R15T1;
                strs[14, 1] = model.R15T2;
                strs[14, 2] = model.R15T3;
                strs[14, 3] = model.R15T4;
                strs[14, 4] = model.R15T5;
                strs[14, 5] = model.R15T6;
                strs[14, 6] = model.R15T7;
                strs[14, 7] = model.R15T8;
                strs[14, 8] = model.R15T9;
                strs[14, 9] = model.R15T10;
                strs[14, 10] = model.R15T11;
                strs[14, 11] = model.R15T12;
                strs[14, 12] = "34";

                strs[15, 0] = model.R16T1;
                strs[15, 1] = model.R16T2;
                strs[15, 2] = model.R16T3;
                strs[15, 3] = model.R16T4;
                strs[15, 4] = model.R16T5;
                strs[15, 5] = model.R16T6;
                strs[15, 6] = model.R16T7;
                strs[15, 7] = model.R16T8;
                strs[15, 8] = model.R16T9;
                strs[15, 9] = model.R16T10;
                strs[15, 10] = model.R16T11;
                strs[15, 11] = model.R16T12;
                strs[15, 12] = "35";

                strs[16, 0] = model.R17T1;
                strs[16, 1] = model.R17T2;
                strs[16, 2] = model.R17T3;
                strs[16, 3] = model.R17T4;
                strs[16, 4] = model.R17T5;
                strs[16, 5] = model.R17T6;
                strs[16, 6] = model.R17T7;
                strs[16, 7] = model.R17T8;
                strs[16, 8] = model.R17T9;
                strs[16, 9] = model.R17T10;
                strs[16, 10] = model.R17T11;
                strs[16, 11] = model.R17T12;
                strs[16, 12] = "36";

                strs[17, 0] = model.R18T1;
                strs[17, 1] = model.R18T2;
                strs[17, 2] = model.R18T3;
                strs[17, 3] = model.R18T4;
                strs[17, 4] = model.R18T5;
                strs[17, 5] = model.R18T6;
                strs[17, 6] = model.R18T7;
                strs[17, 7] = model.R18T8;
                strs[17, 8] = model.R18T9;
                strs[17, 9] = model.R18T10;
                strs[17, 10] = model.R18T11;
                strs[17, 11] = model.R18T12;
                strs[17, 12] = "37";

                strs[18, 0] = model.R19T1;
                strs[18, 1] = model.R19T2;
                strs[18, 2] = model.R19T3;
                strs[18, 3] = model.R19T4;
                strs[18, 4] = model.R19T5;
                strs[18, 5] = model.R19T6;
                strs[18, 6] = model.R19T7;
                strs[18, 7] = model.R19T8;
                strs[18, 8] = model.R19T9;
                strs[18, 9] = model.R19T10;
                strs[18, 10] = model.R19T11;
                strs[18, 11] = model.R19T12;
                strs[18, 12] = "38";

                strs[19, 0] = model.R20T1;
                strs[19, 1] = model.R20T2;
                strs[19, 2] = model.R20T3;
                strs[19, 3] = model.R20T4;
                strs[19, 4] = model.R20T5;
                strs[19, 5] = model.R20T6;
                strs[19, 6] = model.R20T7;
                strs[19, 7] = model.R20T8;
                strs[19, 8] = model.R20T9;
                strs[19, 9] = model.R20T10;
                strs[19, 10] = model.R20T11;
                strs[19, 11] = model.R20T12;
                strs[19, 12] = "39";

                strs[20, 0] = model.R21T1;
                strs[20, 1] = model.R21T2;
                strs[20, 2] = model.R21T3;
                strs[20, 3] = model.R21T4;
                strs[20, 4] = model.R21T5;
                strs[20, 5] = model.R21T6;
                strs[20, 6] = model.R21T7;
                strs[20, 7] = model.R21T8;
                strs[20, 8] = model.R21T9;
                strs[20, 9] = model.R21T10;
                strs[20, 10] = model.R21T11;
                strs[20, 11] = model.R21T12;
                strs[20, 12] = "40";

                strs[21, 0] = model.R22T1;
                strs[21, 1] = model.R22T2;
                strs[21, 2] = model.R22T3;
                strs[21, 3] = model.R22T4;
                strs[21, 4] = model.R22T5;
                strs[21, 5] = model.R22T6;
                strs[21, 6] = model.R22T7;
                strs[21, 7] = model.R22T8;
                strs[21, 8] = model.R22T9;
                strs[21, 9] = model.R22T10;
                strs[21, 10] = model.R22T11;
                strs[21, 11] = model.R22T12;
                strs[21, 12] = "41";

                strs[22, 0] = model.R23T1;
                strs[22, 1] = model.R23T2;
                strs[22, 2] = model.R23T3;
                strs[22, 3] = model.R23T4;
                strs[22, 4] = model.R23T5;
                strs[22, 5] = model.R23T6;
                strs[22, 6] = model.R23T7;
                strs[22, 7] = model.R23T8;
                strs[22, 8] = model.R23T9;
                strs[22, 9] = model.R23T10;
                strs[22, 10] = model.R23T11;
                strs[22, 11] = model.R23T12;
                strs[22, 12] = "42";
                string OperatorID = ((LogOnModel)(System.Web.HttpContext.Current.Session["user"])).LogName;
                string datetime = model.DateTime;
                string macno = model.MacNo;
                string starttime = model.StartTime;
                string endtime = model.EndTime;
                string DataFlag = model.DataFlag;
                result = fundinfo.SaveRefrigeration(strs, datetime, DataFlag, OperatorID, macno, starttime, endtime);
            }
            return Json(result);
        }

        /// <summary>
        /// 点击改卡按钮执行的方法
        /// </summary>
        /// <param name="supplierNo"></param>
        /// <returns></returns>
        public ActionResult ReportV(string DateTime, string BanCi)
        {
            RefrigerationVM vm = new RefrigerationVM();
            ViewBag.BanCi1 = BanCi;
            ViewBag.DateTime = DateTime;
            DataSet ds = GetList(DateTime, BanCi);
            List<RefrigerationInfo> il = new List<RefrigerationInfo>();
            RefrigerationInfo hi = null;
            ViewBag.OperatorID = ((LogOnModel)(System.Web.HttpContext.Current.Session["user"])).LogName;
            vm.MacNo = ds.Tables[0].Rows[0]["MacNo"].ToString();
            vm.StartTime = ds.Tables[0].Rows[0]["StartTime"].ToString();
            vm.EndTime = ds.Tables[0].Rows[0]["EndTime"].ToString();
            vm.DateTime = DateTime;
            vm.DataFlag = BanCi;
            DataTable dt = ds.Tables[0];
            vm.R1T1 = dt.Rows[0]["T1"].ToString();
            vm.R1T2 = dt.Rows[0]["T2"].ToString();
            vm.R1T3 = dt.Rows[0]["T3"].ToString();
            vm.R1T4 = dt.Rows[0]["T4"].ToString();
            vm.R1T5 = dt.Rows[0]["T5"].ToString();
            vm.R1T6 = dt.Rows[0]["T6"].ToString();
            vm.R1T7 = dt.Rows[0]["T7"].ToString();
            vm.R1T8 = dt.Rows[0]["T8"].ToString();
            vm.R1T9 = dt.Rows[0]["T9"].ToString();
            vm.R1T10 = dt.Rows[0]["T10"].ToString();
            vm.R1T11 = dt.Rows[0]["T11"].ToString();
            vm.R1T12 = dt.Rows[0]["T12"].ToString();

            vm.R2T1 = dt.Rows[1]["T1"].ToString();
            vm.R2T2 = dt.Rows[1]["T2"].ToString();
            vm.R2T3 = dt.Rows[1]["T3"].ToString();
            vm.R2T4 = dt.Rows[1]["T4"].ToString();
            vm.R2T5 = dt.Rows[1]["T5"].ToString();
            vm.R2T6 = dt.Rows[1]["T6"].ToString();
            vm.R2T7 = dt.Rows[1]["T7"].ToString();
            vm.R2T8 = dt.Rows[1]["T8"].ToString();
            vm.R2T9 = dt.Rows[1]["T9"].ToString();
            vm.R2T10 = dt.Rows[1]["T10"].ToString();
            vm.R2T11 = dt.Rows[1]["T11"].ToString();
            vm.R2T12 = dt.Rows[1]["T12"].ToString();

            vm.R3T1 = dt.Rows[2]["T1"].ToString();
            vm.R3T2 = dt.Rows[2]["T2"].ToString();
            vm.R3T3 = dt.Rows[2]["T3"].ToString();
            vm.R3T4 = dt.Rows[2]["T4"].ToString();
            vm.R3T5 = dt.Rows[2]["T5"].ToString();
            vm.R3T6 = dt.Rows[2]["T6"].ToString();
            vm.R3T7 = dt.Rows[2]["T7"].ToString();
            vm.R3T8 = dt.Rows[2]["T8"].ToString();
            vm.R3T9 = dt.Rows[2]["T9"].ToString();
            vm.R3T10 = dt.Rows[2]["T10"].ToString();
            vm.R3T11 = dt.Rows[2]["T11"].ToString();
            vm.R3T12 = dt.Rows[2]["T12"].ToString();

            vm.R4T1 = dt.Rows[3]["T1"].ToString();
            vm.R4T2 = dt.Rows[3]["T2"].ToString();
            vm.R4T3 = dt.Rows[3]["T3"].ToString();
            vm.R4T4 = dt.Rows[3]["T4"].ToString();
            vm.R4T5 = dt.Rows[3]["T5"].ToString();
            vm.R4T6 = dt.Rows[3]["T6"].ToString();
            vm.R4T7 = dt.Rows[3]["T7"].ToString();
            vm.R4T8 = dt.Rows[3]["T8"].ToString();
            vm.R4T9 = dt.Rows[3]["T9"].ToString();
            vm.R4T10 = dt.Rows[3]["T10"].ToString();
            vm.R4T11 = dt.Rows[3]["T11"].ToString();
            vm.R4T12 = dt.Rows[3]["T12"].ToString();

            vm.R5T1 = dt.Rows[4]["T1"].ToString();
            vm.R5T2 = dt.Rows[4]["T2"].ToString();
            vm.R5T3 = dt.Rows[4]["T3"].ToString();
            vm.R5T4 = dt.Rows[4]["T4"].ToString();
            vm.R5T5 = dt.Rows[4]["T5"].ToString();
            vm.R5T6 = dt.Rows[4]["T6"].ToString();
            vm.R5T7 = dt.Rows[4]["T7"].ToString();
            vm.R5T8 = dt.Rows[4]["T8"].ToString();
            vm.R5T9 = dt.Rows[4]["T9"].ToString();
            vm.R5T10 = dt.Rows[4]["T10"].ToString();
            vm.R5T11 = dt.Rows[4]["T11"].ToString();
            vm.R5T12 = dt.Rows[4]["T12"].ToString();

            vm.R6T1 = dt.Rows[5]["T1"].ToString();
            vm.R6T2 = dt.Rows[5]["T2"].ToString();
            vm.R6T3 = dt.Rows[5]["T3"].ToString();
            vm.R6T4 = dt.Rows[5]["T4"].ToString();
            vm.R6T5 = dt.Rows[5]["T5"].ToString();
            vm.R6T6 = dt.Rows[5]["T6"].ToString();
            vm.R6T7 = dt.Rows[5]["T7"].ToString();
            vm.R6T8 = dt.Rows[5]["T8"].ToString();
            vm.R6T9 = dt.Rows[5]["T9"].ToString();
            vm.R6T10 = dt.Rows[5]["T10"].ToString();
            vm.R6T11 = dt.Rows[5]["T11"].ToString();
            vm.R6T12 = dt.Rows[5]["T12"].ToString();

            vm.R7T1 = dt.Rows[6]["T1"].ToString();
            vm.R7T2 = dt.Rows[6]["T2"].ToString();
            vm.R7T3 = dt.Rows[6]["T3"].ToString();
            vm.R7T4 = dt.Rows[6]["T4"].ToString();
            vm.R7T5 = dt.Rows[6]["T5"].ToString();
            vm.R7T6 = dt.Rows[6]["T6"].ToString();
            vm.R7T7 = dt.Rows[6]["T7"].ToString();
            vm.R7T8 = dt.Rows[6]["T8"].ToString();
            vm.R7T9 = dt.Rows[6]["T9"].ToString();
            vm.R7T10 = dt.Rows[6]["T10"].ToString();
            vm.R7T11 = dt.Rows[6]["T11"].ToString();
            vm.R7T12 = dt.Rows[6]["T12"].ToString();

            vm.R8T1 = dt.Rows[7]["T1"].ToString();
            vm.R8T2 = dt.Rows[7]["T2"].ToString();
            vm.R8T3 = dt.Rows[7]["T3"].ToString();
            vm.R8T4 = dt.Rows[7]["T4"].ToString();
            vm.R8T5 = dt.Rows[7]["T5"].ToString();
            vm.R8T6 = dt.Rows[7]["T6"].ToString();
            vm.R8T7 = dt.Rows[7]["T7"].ToString();
            vm.R8T8 = dt.Rows[7]["T8"].ToString();
            vm.R8T9 = dt.Rows[7]["T9"].ToString();
            vm.R8T10 = dt.Rows[7]["T10"].ToString();
            vm.R8T11 = dt.Rows[7]["T11"].ToString();
            vm.R8T12 = dt.Rows[7]["T12"].ToString();

            vm.R9T1 = dt.Rows[8]["T1"].ToString();
            vm.R9T2 = dt.Rows[8]["T2"].ToString();
            vm.R9T3 = dt.Rows[8]["T3"].ToString();
            vm.R9T4 = dt.Rows[8]["T4"].ToString();
            vm.R9T5 = dt.Rows[8]["T5"].ToString();
            vm.R9T6 = dt.Rows[8]["T6"].ToString();
            vm.R9T7 = dt.Rows[8]["T7"].ToString();
            vm.R9T8 = dt.Rows[8]["T8"].ToString();
            vm.R9T9 = dt.Rows[8]["T9"].ToString();
            vm.R9T10 = dt.Rows[8]["T10"].ToString();
            vm.R9T11 = dt.Rows[8]["T11"].ToString();
            vm.R9T12 = dt.Rows[8]["T12"].ToString();

            vm.R10T1 = dt.Rows[9]["T1"].ToString();
            vm.R10T2 = dt.Rows[9]["T2"].ToString();
            vm.R10T3 = dt.Rows[9]["T3"].ToString();
            vm.R10T4 = dt.Rows[9]["T4"].ToString();
            vm.R10T5 = dt.Rows[9]["T5"].ToString();
            vm.R10T6 = dt.Rows[9]["T6"].ToString();
            vm.R10T7 = dt.Rows[9]["T7"].ToString();
            vm.R10T8 = dt.Rows[9]["T8"].ToString();
            vm.R10T9 = dt.Rows[9]["T9"].ToString();
            vm.R10T10 = dt.Rows[9]["T10"].ToString();
            vm.R10T11 = dt.Rows[9]["T11"].ToString();
            vm.R10T12 = dt.Rows[9]["T12"].ToString();

            vm.R11T1 = dt.Rows[10]["T1"].ToString();
            vm.R11T2 = dt.Rows[10]["T2"].ToString();
            vm.R11T3 = dt.Rows[10]["T3"].ToString();
            vm.R11T4 = dt.Rows[10]["T4"].ToString();
            vm.R11T5 = dt.Rows[10]["T5"].ToString();
            vm.R11T6 = dt.Rows[10]["T6"].ToString();
            vm.R11T7 = dt.Rows[10]["T7"].ToString();
            vm.R11T8 = dt.Rows[10]["T8"].ToString();
            vm.R11T9 = dt.Rows[10]["T9"].ToString();
            vm.R11T10 = dt.Rows[10]["T10"].ToString();
            vm.R11T11 = dt.Rows[10]["T11"].ToString();
            vm.R11T12 = dt.Rows[10]["T12"].ToString();

            vm.R12T1 = dt.Rows[11]["T1"].ToString();
            vm.R12T2 = dt.Rows[11]["T2"].ToString();
            vm.R12T3 = dt.Rows[11]["T3"].ToString();
            vm.R12T4 = dt.Rows[11]["T4"].ToString();
            vm.R12T5 = dt.Rows[11]["T5"].ToString();
            vm.R12T6 = dt.Rows[11]["T6"].ToString();
            vm.R12T7 = dt.Rows[11]["T7"].ToString();
            vm.R12T8 = dt.Rows[11]["T8"].ToString();
            vm.R12T9 = dt.Rows[11]["T9"].ToString();
            vm.R12T10 = dt.Rows[11]["T10"].ToString();
            vm.R12T11 = dt.Rows[11]["T11"].ToString();
            vm.R12T12 = dt.Rows[11]["T12"].ToString();

            vm.R13T1 = dt.Rows[12]["T1"].ToString();
            vm.R13T2 = dt.Rows[12]["T2"].ToString();
            vm.R13T3 = dt.Rows[12]["T3"].ToString();
            vm.R13T4 = dt.Rows[12]["T4"].ToString();
            vm.R13T5 = dt.Rows[12]["T5"].ToString();
            vm.R13T6 = dt.Rows[12]["T6"].ToString();
            vm.R13T7 = dt.Rows[12]["T7"].ToString();
            vm.R13T8 = dt.Rows[12]["T8"].ToString();
            vm.R13T9 = dt.Rows[12]["T9"].ToString();
            vm.R13T10 = dt.Rows[12]["T10"].ToString();
            vm.R13T11 = dt.Rows[12]["T11"].ToString();
            vm.R13T12 = dt.Rows[12]["T12"].ToString();

            vm.R14T1 = dt.Rows[13]["T1"].ToString();
            vm.R14T2 = dt.Rows[13]["T2"].ToString();
            vm.R14T3 = dt.Rows[13]["T3"].ToString();
            vm.R14T4 = dt.Rows[13]["T4"].ToString();
            vm.R14T5 = dt.Rows[13]["T5"].ToString();
            vm.R14T6 = dt.Rows[13]["T6"].ToString();
            vm.R14T7 = dt.Rows[13]["T7"].ToString();
            vm.R14T8 = dt.Rows[13]["T8"].ToString();
            vm.R14T9 = dt.Rows[13]["T9"].ToString();
            vm.R14T10 = dt.Rows[13]["T10"].ToString();
            vm.R14T11 = dt.Rows[13]["T11"].ToString();
            vm.R14T12 = dt.Rows[13]["T12"].ToString();

            vm.R15T1 = dt.Rows[14]["T1"].ToString();
            vm.R15T2 = dt.Rows[14]["T2"].ToString();
            vm.R15T3 = dt.Rows[14]["T3"].ToString();
            vm.R15T4 = dt.Rows[14]["T4"].ToString();
            vm.R15T5 = dt.Rows[14]["T5"].ToString();
            vm.R15T6 = dt.Rows[14]["T6"].ToString();
            vm.R15T7 = dt.Rows[14]["T7"].ToString();
            vm.R15T8 = dt.Rows[14]["T8"].ToString();
            vm.R15T9 = dt.Rows[14]["T9"].ToString();
            vm.R15T10 = dt.Rows[14]["T10"].ToString();
            vm.R15T11 = dt.Rows[14]["T11"].ToString();
            vm.R15T12 = dt.Rows[14]["T12"].ToString();

            vm.R16T1 = dt.Rows[15]["T1"].ToString();
            vm.R16T2 = dt.Rows[15]["T2"].ToString();
            vm.R16T3 = dt.Rows[15]["T3"].ToString();
            vm.R16T4 = dt.Rows[15]["T4"].ToString();
            vm.R16T5 = dt.Rows[15]["T5"].ToString();
            vm.R16T6 = dt.Rows[15]["T6"].ToString();
            vm.R16T7 = dt.Rows[15]["T7"].ToString();
            vm.R16T8 = dt.Rows[15]["T8"].ToString();
            vm.R16T9 = dt.Rows[15]["T9"].ToString();
            vm.R16T10 = dt.Rows[15]["T10"].ToString();
            vm.R16T11 = dt.Rows[15]["T11"].ToString();
            vm.R16T12 = dt.Rows[15]["T12"].ToString();

            vm.R17T1 = dt.Rows[16]["T1"].ToString();
            vm.R17T2 = dt.Rows[16]["T2"].ToString();
            vm.R17T3 = dt.Rows[16]["T3"].ToString();
            vm.R17T4 = dt.Rows[16]["T4"].ToString();
            vm.R17T5 = dt.Rows[16]["T5"].ToString();
            vm.R17T6 = dt.Rows[16]["T6"].ToString();
            vm.R17T7 = dt.Rows[16]["T7"].ToString();
            vm.R17T8 = dt.Rows[16]["T8"].ToString();
            vm.R17T9 = dt.Rows[16]["T9"].ToString();
            vm.R17T10 = dt.Rows[16]["T10"].ToString();
            vm.R17T11 = dt.Rows[16]["T11"].ToString();
            vm.R17T12 = dt.Rows[16]["T12"].ToString();

            vm.R18T1 = dt.Rows[17]["T1"].ToString();
            vm.R18T2 = dt.Rows[17]["T2"].ToString();
            vm.R18T3 = dt.Rows[17]["T3"].ToString();
            vm.R18T4 = dt.Rows[17]["T4"].ToString();
            vm.R18T5 = dt.Rows[17]["T5"].ToString();
            vm.R18T6 = dt.Rows[17]["T6"].ToString();
            vm.R18T7 = dt.Rows[17]["T7"].ToString();
            vm.R18T8 = dt.Rows[17]["T8"].ToString();
            vm.R18T9 = dt.Rows[17]["T9"].ToString();
            vm.R18T10 = dt.Rows[17]["T10"].ToString();
            vm.R18T11 = dt.Rows[17]["T11"].ToString();
            vm.R18T12 = dt.Rows[17]["T12"].ToString();

            vm.R19T1 = dt.Rows[18]["T1"].ToString();
            vm.R19T2 = dt.Rows[18]["T2"].ToString();
            vm.R19T3 = dt.Rows[18]["T3"].ToString();
            vm.R19T4 = dt.Rows[18]["T4"].ToString();
            vm.R19T5 = dt.Rows[18]["T5"].ToString();
            vm.R19T6 = dt.Rows[18]["T6"].ToString();
            vm.R19T7 = dt.Rows[18]["T7"].ToString();
            vm.R19T8 = dt.Rows[18]["T8"].ToString();
            vm.R19T9 = dt.Rows[18]["T9"].ToString();
            vm.R19T10 = dt.Rows[18]["T10"].ToString();
            vm.R19T11 = dt.Rows[18]["T11"].ToString();
            vm.R19T12 = dt.Rows[18]["T12"].ToString();

            vm.R20T1 = dt.Rows[19]["T1"].ToString();
            vm.R20T2 = dt.Rows[19]["T2"].ToString();
            vm.R20T3 = dt.Rows[19]["T3"].ToString();
            vm.R20T4 = dt.Rows[19]["T4"].ToString();
            vm.R20T5 = dt.Rows[19]["T5"].ToString();
            vm.R20T6 = dt.Rows[19]["T6"].ToString();
            vm.R20T7 = dt.Rows[19]["T7"].ToString();
            vm.R20T8 = dt.Rows[19]["T8"].ToString();
            vm.R20T9 = dt.Rows[19]["T9"].ToString();
            vm.R20T10 = dt.Rows[19]["T10"].ToString();
            vm.R20T11 = dt.Rows[19]["T11"].ToString();
            vm.R20T12 = dt.Rows[19]["T12"].ToString();

            vm.R21T1 = dt.Rows[20]["T1"].ToString();
            vm.R21T2 = dt.Rows[20]["T2"].ToString();
            vm.R21T3 = dt.Rows[20]["T3"].ToString();
            vm.R21T4 = dt.Rows[20]["T4"].ToString();
            vm.R21T5 = dt.Rows[20]["T5"].ToString();
            vm.R21T6 = dt.Rows[20]["T6"].ToString();
            vm.R21T7 = dt.Rows[20]["T7"].ToString();
            vm.R21T8 = dt.Rows[20]["T8"].ToString();
            vm.R21T9 = dt.Rows[20]["T9"].ToString();
            vm.R21T10 = dt.Rows[20]["T10"].ToString();
            vm.R21T11 = dt.Rows[20]["T11"].ToString();
            vm.R21T12 = dt.Rows[20]["T12"].ToString();

            vm.R22T1 = dt.Rows[21]["T1"].ToString();
            vm.R22T2 = dt.Rows[21]["T2"].ToString();
            vm.R22T3 = dt.Rows[21]["T3"].ToString();
            vm.R22T4 = dt.Rows[21]["T4"].ToString();
            vm.R22T5 = dt.Rows[21]["T5"].ToString();
            vm.R22T6 = dt.Rows[21]["T6"].ToString();
            vm.R22T7 = dt.Rows[21]["T7"].ToString();
            vm.R22T8 = dt.Rows[21]["T8"].ToString();
            vm.R22T9 = dt.Rows[21]["T9"].ToString();
            vm.R22T10 = dt.Rows[21]["T10"].ToString();
            vm.R22T11 = dt.Rows[21]["T11"].ToString();
            vm.R22T12 = dt.Rows[21]["T12"].ToString();

            vm.R23T1 = dt.Rows[22]["T1"].ToString();
            vm.R23T2 = dt.Rows[22]["T2"].ToString();
            vm.R23T3 = dt.Rows[22]["T3"].ToString();
            vm.R23T4 = dt.Rows[22]["T4"].ToString();
            vm.R23T5 = dt.Rows[22]["T5"].ToString();
            vm.R23T6 = dt.Rows[22]["T6"].ToString();
            vm.R23T7 = dt.Rows[22]["T7"].ToString();
            vm.R23T8 = dt.Rows[22]["T8"].ToString();
            vm.R23T9 = dt.Rows[22]["T9"].ToString();
            vm.R23T10 = dt.Rows[22]["T10"].ToString();
            vm.R23T11 = dt.Rows[22]["T11"].ToString();
            vm.R23T12 = dt.Rows[22]["T12"].ToString();
            return View(vm);
        }

        /// <summary>
        /// 报表导出
        /// </summary>
        /// <returns></returns>
        public ActionResult ReportOut(string DateTime, string BanCi)
        {
            return EContent(DateTime, BanCi);
        }

        public ExcelContentResult EContent(string DateTime, string BanCi)
        {
            ViewBag.BanCi1 = BanCi;
            ViewBag.DateTime = DateTime;
            DataSet ds = GetList(DateTime, BanCi);
            List<RefrigerationInfo> il = new List<RefrigerationInfo>();
            RefrigerationInfo hi = null;
            if (ds.Tables[0].Rows.Count != 0)
            {
                ViewBag.OperatorID = ds.Tables[0].Rows[0]["OperatorID"].ToString();
                ViewBag.MacNo = ds.Tables[0].Rows[0]["MacNo"].ToString();
                ViewBag.StartTime = ds.Tables[0].Rows[0]["StartTime"].ToString();
                ViewBag.EndTime = ds.Tables[0].Rows[0]["EndTime"].ToString();

                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    hi = new RefrigerationInfo();
                    hi.T1 = dr["T1"].ToString();
                    hi.T2 = dr["T2"].ToString();
                    hi.T3 = dr["T3"].ToString();
                    hi.T4 = dr["T4"].ToString();
                    hi.T5 = dr["T5"].ToString();
                    hi.T6 = dr["T6"].ToString();
                    hi.T7 = dr["T7"].ToString();
                    hi.T8 = dr["T8"].ToString();
                    hi.T9 = dr["T9"].ToString();
                    hi.T10 = dr["T10"].ToString();
                    hi.T11 = dr["T11"].ToString();
                    hi.T12 = dr["T12"].ToString();
                    hi.Name = dr["ItemName"].ToString();
                    il.Add(hi);
                }
                ViewData["AllInfo"] = il;
            }
            else
            {
                for (int i = 0; i < 23; i++)
                {
                    hi = new RefrigerationInfo();
                    hi.T1 = "";
                    hi.T2 = "";
                    hi.T3 = "";
                    hi.T4 = "";
                    hi.T5 = "";
                    hi.T6 = "";
                    hi.T7 = "";
                    hi.T8 = "";
                    hi.T9 = "";
                    hi.T10 = "";
                    hi.T11 = "";
                    hi.T12 = "";
                    hi.Name = "";
                    il.Add(hi);
                }
                ViewData["AllInfo"] = il;
            }
            StringBuilder sBuilder = new StringBuilder();
            sBuilder.Append("<table cellspacing='0' cellpadding='5' rules='all' border='1'>");
            sBuilder.Append("<tr><td colspan='16' style='font-size: 25px; text-align: center;'>物业工程部空调机组运行日志<br />(制冷)</td></tr>");
            sBuilder.Append("<tr><td colspan='5' style='font-size: 14px; text-align: left;'>日期：" + ViewBag.DateTime + "</td>");
            if (ViewBag.BanCi1 == "0")
            {
                sBuilder.Append("<td colspan='6' style='font-size: 14px; text-align: left;'>早班当班人：" + ViewBag.OperatorID + "</td>");
            }
            else
            {
                sBuilder.Append("<td colspan='6' style='font-size: 14px; text-align: left;'>夜班当班人：" + ViewBag.OperatorID + "</td>");
            }
            sBuilder.Append("<td colspan='5' style='font-size: 14px; text-align: left;'>开机编号：" + ViewBag.MacNo + "</td></tr>");
            sBuilder.Append("<tr><td colspan='5' style='font-size: 14px; text-align: left;'>每小时记录一次：</td>");
            sBuilder.Append("<td colspan='6' style='font-size: 14px; text-align: left;'>开机时间：" + ViewBag.StartTime + "</td>");
            sBuilder.Append("<td colspan='5' style='font-size: 14px; text-align: left;'>停机时间：" + ViewBag.EndTime + "</td></tr>");
            sBuilder.Append("<tr><td style='font-size: 14px; text-align: left;'>项目</td>");
            sBuilder.Append("<td colspan='3' style='font-size: 14px; text-align: left;'>记录时间</td>");
            if (ViewBag.BanCi1 == "0")
            {
                sBuilder.Append("<td style='font-size: 14px; text-align: left;'>7:00</td>");
                sBuilder.Append("<td style='font-size: 14px; text-align: left;'>8:00</td>");
                sBuilder.Append("<td style='font-size: 14px; text-align: left;'>9:00</td>");
                sBuilder.Append("<td style='font-size: 14px; text-align: left;'>10:00</td>");
                sBuilder.Append("<td style='font-size: 14px; text-align: left;'>11:00</td>");
                sBuilder.Append("<td style='font-size: 14px; text-align: left;'>12:00</td>");
                sBuilder.Append("<td style='font-size: 14px; text-align: left;'>13:00</td>");
                sBuilder.Append("<td style='font-size: 14px; text-align: left;'>14:00</td>");
                sBuilder.Append("<td style='font-size: 14px; text-align: left;'>15:00</td>");
                sBuilder.Append("<td style='font-size: 14px; text-align: left;'>16:00</td>");
                sBuilder.Append("<td style='font-size: 14px; text-align: left;'>17:00</td>");
                sBuilder.Append("<td style='font-size: 14px; text-align: left;'>18:00</td></tr>");
            }
            else
            {
                sBuilder.Append("<td style='font-size: 14px; text-align: left;'>19:00</td>");
                sBuilder.Append("<td style='font-size: 14px; text-align: left;'>20:00</td>");
                sBuilder.Append("<td style='font-size: 14px; text-align: left;'>21:00</td>");
                sBuilder.Append("<td style='font-size: 14px; text-align: left;'>22:00</td>");
                sBuilder.Append("<td style='font-size: 14px; text-align: left;'>23:00</td>");
                sBuilder.Append("<td style='font-size: 14px; text-align: left;'>0:00</td>");
                sBuilder.Append("<td style='font-size: 14px; text-align: left;'>1:00</td>");
                sBuilder.Append("<td style='font-size: 14px; text-align: left;'>2:00</td>");
                sBuilder.Append("<td style='font-size: 14px; text-align: left;'>3:00</td>");
                sBuilder.Append("<td style='font-size: 14px; text-align: left;'>4:00</td>");
                sBuilder.Append("<td style='font-size: 14px; text-align: left;'>5:00</td>");
                sBuilder.Append("<td style='font-size: 14px; text-align: left;'>6:00</td></tr>");
            }
            sBuilder.Append("<tr><td style='font-size: 14px; text-align: left;' rowspan='3'>温<br />度<br />(C)</td>");
            List<RefrigerationInfo> listmodu = ViewData["AllInfo"] as List<RefrigerationInfo>;
            sBuilder.Append("<td style='font-size: 14px; text-align: left;' colspan='3'>" + listmodu[0].Name + "</td>");
            sBuilder.Append("<td>" + listmodu[0].T1 + "</td><td>" + listmodu[0].T2 + "</td><td>" + listmodu[0].T3 + "</td><td>" + listmodu[0].T4 + "</td><td>" + listmodu[0].T5 + "</td><td>" + listmodu[0].T6 + "</td><td>" + listmodu[0].T7 + "</td>");
            sBuilder.Append("<td>" + listmodu[0].T8 + "</td><td>" + listmodu[0].T9 + "</td><td>" + listmodu[0].T10 + "</td><td>" + listmodu[0].T11 + "</td><td>" + listmodu[0].T12 + "</td></tr>");
            sBuilder.Append("<tr><td style='font-size: 14px; text-align: left;' colspan='3'>" + listmodu[1].Name + "</td>");
            sBuilder.Append("<td>" + listmodu[1].T1 + "</td><td>" + listmodu[1].T2 + "</td><td>" + listmodu[1].T3 + "</td><td>" + listmodu[1].T4 + "</td><td>" + listmodu[1].T5 + "</td><td>" + listmodu[1].T6 + "</td><td>" + listmodu[1].T7 + "</td>");
            sBuilder.Append("<td>" + listmodu[1].T8 + "</td><td>" + listmodu[1].T9 + "</td><td>" + listmodu[1].T10 + "</td><td>" + listmodu[1].T11 + "</td><td>" + listmodu[1].T12 + "</td></tr>");
            sBuilder.Append("<tr><td style='font-size: 14px; text-align: left;' colspan='3'>" + listmodu[2].Name + "</td>");
            sBuilder.Append("<td>" + listmodu[2].T1 + "</td><td>" + listmodu[2].T2 + "</td><td>" + listmodu[2].T3 + "</td><td>" + listmodu[2].T4 + "</td><td>" + listmodu[2].T5 + "</td><td>" + listmodu[2].T6 + "</td><td>" + listmodu[2].T7 + "</td>");
            sBuilder.Append("<td>" + listmodu[2].T8 + "</td><td>" + listmodu[2].T9 + "</td><td>" + listmodu[2].T10 + "</td><td>" + listmodu[2].T11 + "</td><td>" + listmodu[2].T12 + "</td></tr>");
       
            sBuilder.Append("<tr><td style='font-size: 14px; text-align: left;' rowspan='5'>压<br />力<br />(Mpa)</td>");
            sBuilder.Append("<td style='font-size: 14px; text-align: left;' colspan='3'>" + listmodu[3].Name + "</td>");
            sBuilder.Append("<td>" + listmodu[3].T1 + "</td><td>" + listmodu[3].T2 + "</td><td>" + listmodu[3].T3 + "</td><td>" + listmodu[3].T4 + "</td><td>" + listmodu[3].T5 + "</td><td>" + listmodu[3].T6 + "</td><td>" + listmodu[3].T7 + "</td>");
            sBuilder.Append("<td>" + listmodu[3].T8 + "</td><td>" + listmodu[3].T9 + "</td><td>" + listmodu[3].T10 + "</td><td>" + listmodu[3].T11 + "</td><td>" + listmodu[3].T12 + "</td></tr>");
            for (int i = 4; i < 8; i++)
            {
                sBuilder.Append("<tr><td style='font-size: 14px; text-align: left;' colspan='3'>" + listmodu[i].Name + "</td>");
                sBuilder.Append("<td>" + listmodu[i].T1 + "</td><td>" + listmodu[i].T2 + "</td><td>" + listmodu[i].T3 + "</td><td>" + listmodu[i].T4 + "</td><td>" + listmodu[i].T5 + "</td><td>" + listmodu[i].T6 + "</td><td>" + listmodu[i].T7 + "</td>");
                sBuilder.Append("<td>" + listmodu[i].T8 + "</td><td>" + listmodu[i].T9 + "</td><td>" + listmodu[i].T10 + "</td><td>" + listmodu[i].T11 + "</td><td>" + listmodu[i].T12 + "</td></tr>");
            }
            for (int i = 8; i < 11; i++)
            {
                sBuilder.Append("<tr><td style='font-size: 14px; text-align: left;' colspan='4'>" + listmodu[i].Name + "</td>");
                sBuilder.Append("<td>" + listmodu[i].T1 + "</td><td>" + listmodu[i].T2 + "</td><td>" + listmodu[i].T3 + "</td><td>" + listmodu[i].T4 + "</td><td>" + listmodu[i].T5 + "</td><td>" + listmodu[i].T6 + "</td><td>" + listmodu[i].T7 + "</td>");
                sBuilder.Append("<td>" + listmodu[i].T8 + "</td><td>" + listmodu[i].T9 + "</td><td>" + listmodu[i].T10 + "</td><td>" + listmodu[i].T11 + "</td><td>" + listmodu[i].T12 + "</td></tr>");
            }
            
            sBuilder.Append("<tr><td colspan='16'>4号烧火器</td></tr>");

            for (int i = 11; i < 15; i++)
            {
                sBuilder.Append("<tr><td style='font-size: 14px; text-align: left;' colspan='4'>" + listmodu[i].Name + "</td>");
                sBuilder.Append("<td>" + listmodu[i].T1 + "</td><td>" + listmodu[i].T2 + "</td><td>" + listmodu[i].T3 + "</td><td>" + listmodu[i].T4 + "</td><td>" + listmodu[i].T5 + "</td><td>" + listmodu[i].T6 + "</td><td>" + listmodu[i].T7 + "</td>");
                sBuilder.Append("<td>" + listmodu[i].T8 + "</td><td>" + listmodu[i].T9 + "</td><td>" + listmodu[i].T10 + "</td><td>" + listmodu[i].T11 + "</td><td>" + listmodu[i].T12 + "</td></tr>");
            }
            sBuilder.Append("<tr><td colspan='16'>每4小时记录一次：</td></tr>");
            sBuilder.Append("<tr><td colspan='2' rowspan='3'>项目</td><td colspan='4'>燃烧</td><td colspan='10'>电流(A)</td></tr>");
            sBuilder.Append("<tr><td>供<br />气<br />压<br />力</td>");
            sBuilder.Append("<td>排<br />烟<br />温<br />度</td>");
            sBuilder.Append("<td colspan='2'>烟<br />气<br />颜<br />色</td>");
            sBuilder.Append("<td colspan='2'>吸<br />收<br />泵</td>");
            sBuilder.Append("<td colspan='2'>冷<br />剂<br />泵</td>");
            sBuilder.Append("<td colspan='2'>冷<br />冻<br />水<br />泵</td>");
            sBuilder.Append("<td colspan='2'>冷<br />却<br />水<br />泵</td>");
            sBuilder.Append("<td colspan='2'>冷<br />却<br />风<br />机</td></tr>");
            sBuilder.Append("<tr><td>50-80MPar</td><td>0-230度</td>");
            sBuilder.Append("<td colspan='2'>白</td><td colspan='2'>0-4A</td><td colspan='2'>0-2.5A</td>");
            sBuilder.Append("<td colspan='2'>64-72A</td><td colspan='2'>65-75A</td><td colspan='2'>18-20A</td></tr>");

            sBuilder.Append("<tr><td colspan='2'>7:00</td><td>" + listmodu[15].T1 + "</td><td>" + listmodu[16].T1 + "</td><td colspan='2'>" + listmodu[17].T1 + "</td>");
            sBuilder.Append("<td colspan='2'>" + listmodu[18].T1 + "</td><td colspan='2'>" + listmodu[19].T1 + "</td><td colspan='2'>" + listmodu[20].T1 + "</td><td colspan='2'>" + listmodu[21].T1 + "</td><td colspan='2'>" + listmodu[22].T1 + "</td></tr>");
            sBuilder.Append("<tr><td colspan='2'>11:00</td><td>" + listmodu[15].T2 + "</td><td>" + listmodu[16].T2 + "</td><td colspan='2'>" + listmodu[17].T2 + "</td>");
            sBuilder.Append("<td colspan='2'>" + listmodu[18].T2 + "</td><td colspan='2'>" + listmodu[19].T2 + "</td><td colspan='2'>" + listmodu[20].T2 + "</td><td colspan='2'>" + listmodu[21].T2 + "</td><td colspan='2'>" + listmodu[22].T2 + "</td></tr>");
            sBuilder.Append("<tr><td colspan='2'>15:00</td><td>" + listmodu[15].T3 + "</td><td>" + listmodu[16].T3 + "</td><td colspan='2'>" + listmodu[17].T3 + "</td>");
            sBuilder.Append("<td colspan='2'>" + listmodu[18].T3 + "</td><td colspan='2'>" + listmodu[19].T3 + "</td><td colspan='2'>" + listmodu[20].T3 + "</td><td colspan='2'>" + listmodu[21].T3 + "</td><td colspan='2'>" + listmodu[22].T3 + "</td></tr>");
            if (ViewBag.BanCi1 == "0")
            {
                sBuilder.Append("<tr><td colspan='3'>天然气表读数：</td><td colspan='13'>抄表时间：7：30</td></tr></table>");
            }
            else
            {
                sBuilder.Append("<tr><td colspan='3'>天然气表读数：</td><td colspan='13'>抄表时间：19：30</td></tr></table>");
            }
            ExcelContentResult econtent = new ExcelContentResult();
            econtent.Content = sBuilder.ToString();
            econtent.filename = "StaffCanteenWarehouseOut";
            econtent.ContentType = "application/ms-excel";
            econtent.ContentEncoding = System.Text.Encoding.GetEncoding("UTF-8");
            return econtent;
        }
    }
}
